﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CuteEditor6x
{
	public partial class index : System.Web.UI.Page
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			if (!this.IsPostBack)
			{
				//在工具栏上插入按钮
				CuteEditor.ToolControl tc = Editor1.ToolControls["insertcustombutonhere"];
				if (tc != null)
				{
					var ico = new System.Web.UI.WebControls.Image();
					ico.ToolTip = "Word一键粘贴";
					ico.ImageUrl = "/WordPaster/css/paster.png";
					ico.CssClass = "CuteEditorButton";
					//SetMouseEvents(ico);
					ico.Attributes["onclick"] = "WordPaster.getInstance().PasteManual()";
					tc.Control.Controls.Add(ico);

					var ico2 = new System.Web.UI.WebControls.Image();
                    ico2.ToolTip = "Word转图片";
                    ico2.ImageUrl = "/WordPaster/css/word1.png";
                    ico2.CssClass = "CuteEditorButton";
                    //SetMouseEvents(Image1);
                    ico2.Attributes["onclick"] = "WordPaster.getInstance().importWordToImg()";
                    tc.Control.Controls.Add(ico2);

                    var ico6 = new System.Web.UI.WebControls.Image();
                    ico6.ToolTip = "导入Word文档";
                    ico6.ImageUrl = "/WordPaster/css/word2.png";
                    ico6.CssClass = "CuteEditorButton";
                    //SetMouseEvents(Image1);
                    ico6.Attributes["onclick"] = "WordPaster.getInstance().importWord()";
                    tc.Control.Controls.Add(ico6);

                    var ico7 = new System.Web.UI.WebControls.Image();
                    ico7.ToolTip = "导入Excel文档";
                    ico7.ImageUrl = "/WordPaster/css/excel.png";
                    ico7.CssClass = "CuteEditorButton";
                    //SetMouseEvents(Image1);
                    ico7.Attributes["onclick"] = "WordPaster.getInstance().importExcel()";
                    tc.Control.Controls.Add(ico7);

                    var ico3 = new System.Web.UI.WebControls.Image();
                    ico3.ToolTip = "导入PowerPoint文档";
                    ico3.ImageUrl = "/WordPaster/css/ppt.png";
                    ico3.CssClass = "CuteEditorButton";
                    //SetMouseEvents(Image1);
                    ico3.Attributes["onclick"] = "WordPaster.getInstance().importPPT()";
                    tc.Control.Controls.Add(ico3);

					var ico4 = new System.Web.UI.WebControls.Image();
                    ico4.ToolTip = "导入PDF文档";
                    ico4.ImageUrl = "/WordPaster/css/pdf.png";
                    ico4.CssClass = "CuteEditorButton";
                    //SetMouseEvents(Image1);
                    ico4.Attributes["onclick"] = "WordPaster.getInstance().ImportPDF()";
                    tc.Control.Controls.Add(ico4);

                    //netpaster
					var ico5 = new System.Web.UI.WebControls.Image();
                    ico5.ToolTip = "自动上传远程服务器图片";
                    ico5.ImageUrl = "/WordPaster/css/ico.png";
                    ico5.CssClass = "CuteEditorButton";
                    //SetMouseEvents(Image1);
                    ico5.Attributes["onclick"] = "WordPaster.getInstance().UploadNetImg()";
					tc.Control.Controls.Add(ico5);
				}
			}
		}
	}
}
